import { PipeTransform } from '@nestjs/common'

// 默认值 管道
export class DefaultValuePipe implements PipeTransform<string, any> {
  constructor(private readonly defaultValue: any) {

  }
  
  transform(value?: string): any {
    return value === undefined ? this.defaultValue : value
  }
}
